package sk.tuke.android4all.controls;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.LinearLayout;

/**
 * Created by Ing. Tibor Fecko on 3.4.2014.
 */
public class ActiveControl extends LinearLayout{

	private static String TAG = "ActiveControl";
	
    public ActiveControl(Context context) {
        super(context);
    }

    public ActiveControl(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ActiveControl(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }
    
    @Override
    public boolean onTouchEvent(MotionEvent mEvent){
        switch (mEvent.getAction()) {
            case MotionEvent.ACTION_DOWN:
                Log.i("ActiveControl", "Motion detected - down");
                return false;

            case MotionEvent.ACTION_MOVE:
                Log.i("ActiveControl", "Motion detected - move");
                this.dispatchGenericMotionEvent(mEvent);
                return true;

            case MotionEvent.ACTION_UP:
                Log.i("ActiveControl", "Motion detected - up");
                return false;
        }
        return true;
    }

}
